<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>院校选择</title>
    <script type="text/javascript"  src="http://code.jquery.com/jquery-1.8.3.js"></script>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script type="text/javascript"  src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <link rel="stylesheet" href="index.css">
  <link rel="stylesheet" href="main.css">
  <link rel="stylesheet" href="volunteer.css">
  <link rel="stylesheet" href="simulation.css">
  <link rel="stylesheet" href="./static/dist/css/bootstrap.css">
  <script type="text/javascript" src="./static/store.legacy.min.js"></script>
  <script src="./static/util.js"></script>
</head>
<body>
  <!-- 自主招生页面 -->
  <header>
    <div class="headerSwipper">
      <div class="headerSwipper_div">
        <div class="headerSwipper_div_iconview">
          <img src="./static/images/logo.png" alt="">
        </div>
        <div class="headerSwipper_div_myicon">
          <!-- <img src="" alt=""> -->
          <span class="loginText">登录</span>
          <div class="headerSwipper_div_myicon_icon" style="display: none">
            <img src="./static/images/iconsmall.png" alt="">
          </div>
          <div class="headerSwipper_div_myicon_info">
            <ul>
              <li class="headerSwipper_div_myicon_info_li">消息</li>
              <li class="headerSwipper_div_myicon_info_li">退出</li>
            </ul>
          </div>
        </div>
        <ul class="headerSwipper_div_ul">
          <li class="headerSwipper_div_li mobileapp">手机APP</li>
          <li class="headerSwipper_div_li vipprop">开通VIP</li>
        </ul>
      </div>
    </div>
  </header>
  <section>
    <div class="ImgSwipperview">
      <img class="ImgSwipperview_img" src="./static/images/mainSwipper.png" alt="">
    </div>
  </section>
  <section>
    <div class="mainContentView">
      <div class="contentView">
        <!-- 上侧导航 -->
        <div class="topnav">
          <ul class="contentView_ul">
            <li class="contentView_li">首页</li>
            <li class="contentView_li">学习中心</li>
            <li class="contentView_li contentView_li_active">志愿填报</li>
            <li class="contentView_li">微课</li>
            <li class="contentView_li">模拟试题</li>
            <li class="contentView_li">往届真题</li>
            <li class="contentView_li">咨询</li>
          </ul>
          <div class="inputview">
            <input class="inputview_input" id="tag" 
 type="text" placeholder="搜索院校">
            <img  class="searchicon_img" src="./static/images/searchicon.png" alt="">
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- 志愿模拟表 -->
  <section>
    <div class="simulation">
      <div class="simview">
        <p class="simview_title bigbottom"></p>
        <table class="table table-bordered typeziyuan">
          <tr>
            <td style="width:120px;"> </td>
            <td style="min-width:300px;">专业</td>
            <td>招生数</td>
            <td>最低分</td>
            <td>难度</td>
          </tr>
        </table>
        <button class="save_btn">确认</button>
      </div>
    </div>
  </section>


  <footer>
    <div class="footerSwipper">
      <div class="footerSwipper_div">
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span"><a href="./index.html">首页</a></span>
          <li class="footerSwipper_div_ul_li"><a href="./schools.html?keyword=">院校大全</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./major.html">专业大全</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./mentality.html">心理辅导</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./careerPlanning.html">职业规划</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./infoTest.html">高考资讯</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./recruitment.html?type=1">自主招生</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./recruitment.html?type=2">单独招生</a></li>
        </ul>
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span">学习提升</span>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=3">微课</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=4">模拟试题</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=5">往届试题</a></li>
        </ul>
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span">志愿填报</span>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=6">咨询</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./mobileapp.html">下载APP</a></li>
        </ul>
        <!-- 扫一扫关注我们区域 -->
        <div class="QRcodeSwipper">
          <span class="QRcodeSwipper_span">扫一扫关注我们</span>
          <div class="QRcodeSwipper_imgview">
            <img src="./static/images/qr.png" alt="">
          </div>
        </div>
        <!-- 中间信息区域 -->
        <div class="middleInfo">
          <span class="middleInfo_span_city">中国·河南·郑州</span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon middleInfo_span_GE_icon_special phone_icon"><img src="./static/images/phone.png" alt=""></span><span class="middleInfo_span_GE_text middleInfo_span_GE_text_color">0371-68064945</span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon message_icon"><img src="./static/images/message.png" alt=""></span><span class="middleInfo_span_GE_text">595879735@qq.com</span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon message_icon"><img src="./static/images/store.png" alt=""></span><span class="middleInfo_span_GE_text">河南柒佰伴教育信息咨询有限公司
          </span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon middleInfo_span_GE_icon_special address_icon"><img src="./static/images/address.png" alt=""></span><span class="middleInfo_span_GE_text middleInfo_span_GE_text_special">郑州市郑东新区立体世界
            </span></span>
        </div>
        <p class="footerSwipper_div_p">河南世霖网络软件科技 2014-2018 豫ICP备14010456号-1</p>
      </div>
    </div>
  </footer>
  <script src="./static/util.js"></script>
  <script>
    $(document).ready(function(){
      // 初始化参数
      var typeindex = getparse(location.href, 0)
      var score = getparse(location.href, 1)
      var type = getparse(location.href, 2)
      var ed = getparse(location.href, 3)
      var type_index = getparse(location.href, 4)
      var list_school22 = store.get('list_school')
      // 批次123 文理科12 分数 类型
      var testQuestion = {
        school_id: typeindex,
        pc_status: ed,
        obj_status: type,
        score: score
      }
      // 登录隐藏
      $('.headerSwipper_div_myicon_info').hide()
      // 页面首页初始化
      ArrowNavigation($('.simview'), ['zhiyuan','simulation'])
      // 接口等下换回来
      function pageinit () {
        $.ajax({
          url: urlhost + '/admin.php/api/goods/tjzy_list',
          method: 'POST',
          data: testQuestion,
          success: function (res) {
            if(res.code == '0') {
              $('.simview_title').text( list_school22.zy_data[type-1].school_name + '2018招生专业选择')
              var data = res.data
              var html = ''
              for(var i=0; i < data.length; i++) {
                html += '<tr school-id="'+ data[i].zy_id +'">'
                     + '<th style="width:120px;">'
                       + '<span class="quadrangle">'
                         + '<span class="quadrangle_Y" style="display: none">&#10004;</span>'
                       + '</span>'
                     + '</th>'
                     + '<th style="min-width:300px;">'+ data[i].title +'</th>'
                     + '<th>'+ data[i].zy_lq_num +'</th>'
                     + '<th>'+ data[i].zy_low_score +'</th>'
                     + '<th>'+ data[i].nand +'</th>'
                   + '</tr>'
              }
              $('.typeziyuan').append(html)
            }
          }
        })
      }
      pageinit()
      // li标签点击 需要跳转页面 同时传递第几个 进行初始化
      $('body').on('click', '.contentView_li', function () {
        var index = $(this).index()
        window.location.href = './index.html?index=' + index
      })
      // 学校选择跳转
      $('.myzhiyuan').on('click', '.school_choice', function (){
        var nameIndex = $(this).parent().find('input[type="text"]').attr('name').slice(3)
        // console.log(nameIndex)
        // window.location.href = './choice_school.html?type=' + nameIndex
      })
      // 点击选中专业事件 最多选择五个
      var active_list = []
      $('.typeziyuan').on('click', '.quadrangle', function () {
        // console.log($(this).find('.quadrangle_Y')[0].style.display)
        
        var ma_id = $(this).parents('tr').attr('school-id')
        var ma_name = $(this).parents('tr').find('th').eq(1).text()
        if($(this).find('.quadrangle_Y')[0].style.display == 'none') {
          if(active_list.length == 5) {
            widowAle('最多添加五个专业')
            return
          }
          $(this).find('.quadrangle_Y').show()
          active_list.push({'zy_id111': ma_id, 'zy_id': ma_name})
          console.log(active_list)
          return
        }else {
          $(this).find('.quadrangle_Y').hide()
          for(var i=0; i < active_list.length; i++) {
            if(active_list[i].zy_id111 == ma_id) {
              active_list.splice(i,1)
            }
          }
          console.log(active_list)
          return
        }
      })
      // 保存跳转事件
      var list_school
      if(!store.get('list_school')) {
        widowAle('请您先选择学校')
      }else {
        list_school = store.get('list_school')
      }
      // type_index ABCDEF专业 type_index - 1
      $('.simulation').on('click', '.save_btn', function () {
        list_school.zy_data[type_index-1].zy = active_list
        store.set('list_school', list_school)
        window.location.replace('./simulation.html?score=' + score + '&sub_type=' + type + '&ed=' + ed)
      })
    })
  </script>
  </body>
</html>
